from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtPrintSupport import *

import abc
from abc import *

class NetworkObject:
    def __init__(self, url, domain, object=None):
        self.url = url
        self.domain = domain
        self.object = object

    def getURL(self):
        return self.url

    def getDomain(self):
        return self.domain

    def get(self):
        return self.object

    def has(self):
        return self.object is not None

class NetworkFilter:
    __metaclass__ = abc.ABCMeta

    @abstractmethod
    def allowRequest(self, networkRequest):
        return True

    @abstractmethod
    def filterName(self):
        return "NetworkFilter.generic"

def makeNetworkObject(url, domain, object):
    return NetworkObject(url, domain, object)